/**
 * 判断图片方向
 * @param url
 */
export function judgeImgDirection(url: string): Promise<'horizontal' | 'vertical'> {
  return new Promise((resolve) => {
    const img = new Image()
    img.src = url
    img.onload = function () {
      if (img.width > img.height) {
        console.log('横图')
        resolve('horizontal')
      } else {
        console.log('竖图')
        resolve('vertical')
      }
    }
  })
}
